import React, { Component } from "react";

import {Switch, BrowserRouter as Router, Route } from "react-router-dom";

import AddAddress from "./addAddress";

import Address from "./address";

import "./css/section.css";
import "./css/reset.css"
import "./css/header.css";
import "./css/add.css";
import "./css/index.css";

let data=[
    {
        concats:'赵小六',
        tel:'13423457890',
        address:'雨欣家园',
        area:'8号楼401室',
        index:0
    },
    {
        concats:'张三',
        tel:'13423457890',
        address:'龙湖小区',
        area:'8号楼401室',
        index:0
    },
    {
        concats:'李四',
        tel:'13423457890',
        address:'龙湖小区',
        area:'8号楼401室',
        index:1
    },
    {
        concats:'王五',
        tel:'13423457890',
        address:'龙湖小区',
        area:'8号楼401室',
        index:0
    }]

class Index extends Component {
    render() {
        return <Router>
            <Switch>
                <Route path="/address" render={()=>{
                    return <Address data={data}></Address>
                }}></Route>
                <Route path="/addAddress" component={AddAddress}></Route>
            </Switch>
        </Router>
    }
}

export default Index;